/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2021-09-14
 * Time:10:56
 */

class Animal1{
    public String name;

    public Animal1(String name){
        this.name = name;
    }
}

interface IFlying{
    void flying();
}

interface ISwing{
    void swimming();
}

interface IRunning{
    void running();
}

class Bird1 extends Animal1 implements IFlying {
    public Bird1(String name){
        super(name);
    }

    @Override
    public void flying() {
        System.out.println(this.name + "正在飞！");
    }
}
//接口的出现就是为了解决多继承，因为类只能单继承
class Cat1 extends Animal1 implements IRunning{

    public Cat1(String name) {
        super(name);
    }

    @Override
    public void running() {
        System.out.println(this.name + "正在跑!");
    }
}

class Robot implements  IRunning{

    @Override
    public void running() {
        System.out.println("机器人在跑！");
    }
}

class Froge extends Animal1 implements ISwing,IRunning{

    public Froge(String name) {
        super(name);
    }

    @Override
    public void swimming() {
        System.out.println("青蛙在游泳！");
    }

    @Override
    public void running() {
        System.out.println("青蛙在跑！");
    }
}
public class TestInter {
    public static void main(String[] args) {
        IRunning iRunning = new Cat1("mimi");
        iRunning.running();
        IRunning iRunning1 = new Robot();
        iRunning1.running();
    }
}
